<template>
  <swiper class="banner" :indicator-dots="true" :autoplay="true" interval="3000" duration="1000">
    <swiper-item v-for="(item, index) in banners" :key="index">
      <image :src="item.logo" mode="widthFix" @tap="handleBannerClick(item)"></image>
    </swiper-item>
  </swiper>
</template>

<script setup>
import {useData} from "../../../common/useData";
import {ref} from "vue";

const searchParams = ref({});
const {modelData:banners} = useData("/shopBanner/list", searchParams);


const handleBannerClick = (item) => {
  emit('bannerClick', item)
}
</script>

<style scoped>
.banner {
  height: 400rpx;
}

.banner image {
  width: 100%;
  height: 100%;
}
</style>
